/**
*图灵机器人
*/
const client = require('../lib/httpclient');
const baseURL = 'http://www.tuling123.com/openapi/api?key='
const tulingAPIKey = '6a2f3bb30c4b4cb5a82aa9a0f6b5bfb4';
const baseURLTail = '&info='
const tulingURL = baseURL + tulingAPIKey + baseURLTail;

function get(str, callback) {
    client.url_get(tulingURL + encodeURI(str), (err, res, info) => {
        callback && callback(JSON.parse(info).text);
    });
}

module.exports = {
    getMsg: get
}
